[FIX] OWDistances: Mahalanobis wrong dimensions notification.#1762
Merged
astaric merged 2 commits intobiolab:masterfrom Nov 18, 2016
Merged
[FIX] OWDistances: Mahalanobis wrong dimensions notification.#1762astaric merged 2 commits intobiolab:masterfrom
astaric merged 2 commits intobiolab:masterfrom
Conversation
owdistances.py: error notification when there is too few observations for Mahalanobis distance. Prevents ValueError exception from distance/__init__.py class MahalanobisDistance.
Member
|
Could you try to write a simple tests which sends the wrong kind of data to distance widget and check that a warning is displayed instead of crashing? |
Current coverage is 88.91% (diff: 100%)@@ master #1762 diff @@
==========================================
Files 82 82
Lines 8847 8847
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
Hits 7866 7866
Misses 981 981
Partials 0 0
|
unsupervised/tests/test_owdistances.py: - tests that compute_distances does not return ValueError - checks if error message is displayed
astaric
reviewed
Nov 18, 2016
| self.widget.axis = 1 | ||
| self.send_signal("Data", self.iris) | ||
| self.widget.compute_distances(Mahalanobis, self.iris) | ||
| self.assertTrue(self.widget.Error.too_few_observations.is_shown()) No newline at end of file |
Member
There was a problem hiding this comment.
Can you please configure PyCharm to always include new line on the last line of file?
http://stackoverflow.com/questions/36043061/automatically-add-newline-on-save-in-pycharm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue
ValueError: 'Too few observations for the number of dimensions.'
Workflow:
Description of changes
Adds shape check and error notification.
Includes
owdistances.py: error notification when there is too few observations for Mahalanobis distance. Prevents ValueError exception from distance/init.py class MahalanobisDistance.